package main

import (
	"regexp"
	"fmt"
)

//const text  =  "my email  is gxgeek@163.com"
const text  =  `my email  is gxgeek@163.com
email1 is abc@def.org
email2 is kkk@qqq.com
email3 is kkk@qqq.com.cn

`
//const text  =  "gxgeek@163.com"
func main() {

	compile  := regexp.MustCompile(`([a-zA-Z0-9]+)@([a-zA-Z0-9]+)(\.[a-zA-Z0-9.]+)`)
	//match := compile.FindAllString(text,-1)
	match := compile.FindAllStringSubmatch(text,-1)
	for k,v := range match {
		fmt.Println(k,v)
		for _,a := range v  {
			fmt.Println(a)
		}
	}

}
